import Mock from 'mockjs'
// 随机生成手机号数组
// const tel = ['13653803755', '15617793826']
// 随机生成身份证号数组
// const idCard = ['4123*****2512', '4247*****4624']
// 随机生成标签
const craftLabel = ['变网', '配电', '电网,配电']

const crafttype = Mock.mock({
  'list|10': [
    {
      'categoryId': '@id',
      'categoryName': '@cname',
      'craftCode': '@word(5)',
      'craftLabel|1': craftLabel,
      'craftName|1': ['工种名称1', '工种名称2'],
      'isRelease|1': [0, 1], // 0未发布 1发布
      'notes': '@cparagraph',
      'workManualId': '@id()',
      'workManualIds': '@id',
      'workManuals': []
    }
  ]
})
const dictMap = {
  // 字典
}
const pub = {
  endRow: 0,
  firstPage: 0,
  hasNextPage: true,
  hasPreviousPage: true,
  isFirstPage: true,
  isLastPage: true,
  lastPage: 0,
  navigatePages: 0,
  navigatepageNums: [],
  nextPage: 0,
  orderBy: '',
  pageNum: 0,
  pageSize: 10,
  pages: 0,
  prePage: 0,
  size: 0,
  totalNum: 30,
  pageIndex: 1,
  startIndex: 0,
  totalPage: 1
}

export default [
  // 电工服务-工种
  // 06-01-03根据id查询工种(不带作业指导书)
  {
    url: '/elec/crafttype/getCraftTypeByid',
    type: 'get',
    response: config => {
      return {
        code: 1,
        data: crafttype.list[0],
        msg: ''
      }
    }
  },
  //   06-01-04分页查询工种集合(不带作业指导书)
  {
    url: '/elec/crafttype/getCraftTypeListPage',
    type: 'post',
    response: config => {
      return {
        code: 1,
        data: {
          ...crafttype,
          ...pub
        },
        dictMap: { ...dictMap },
        msg: ''
      }
    }
  },
  // 06-01-05根据参数查询工种(app web)
  {
    url: '/elec/crafttype/getCraftTypeList',
    type: 'post',
    response: config => {
      return {
        code: 1,
        data: [...crafttype.list],
        dictMap: { ...dictMap },
        msg: ''
      }
    }
  },

  //   06-01-02分页查询工种集合
  {
    url: '/elec/crafttype/getCraftTypeVoListPage',
    type: 'post',
    response: config => {
      return {
        code: 1,
        data: {
          ...crafttype,
          pub
        },
        dictMap: { ...dictMap },
        msg: ''
      }
    }
  },
  //  06-01-07修改保存工种
  {
    url: '/elec/crafttype/modifyCraftType',
    type: 'post',
    response: config => {
      return {
        code: 1,
        data: {},
        msg: ''
      }
    }
  },
  //   06-01-08修改工种发布状态
  {
    url: '/elec/crafttype/releaseCraftType',
    type: 'post',
    response: config => {
      return {
        code: 1,
        data: {},
        msg: ''
      }
    }
  },
  //   06-01-06新增保存工种
  {
    url: '/elec/crafttype/saveCraftType',
    type: 'post',
    response: config => {
      return {
        code: 1,
        data: {},
        msg: ''
      }
    }
  }

]
